#include "map.h"

ALLEGRO_BITMAP *Map::bmap = NULL; //Bitmaps::get_default_bitmap(SAND);

Movable_type Map::element(int x_loc, int y_loc)
{
	return _screen_map[x_loc][y_loc];
}
	
void Map::set_type(Movable_type type, int x_loc, int y_loc)
{
	 Map::_screen_map[x_loc][y_loc] = type;
}

 ALLEGRO_BITMAP *Map::bitmap()
 {
	 return bmap;
 }

 void Map::generate_default_map()
{
	vector<Movable_type> _line_map;

	vector<vector<Movable_type>> _lines_map;

	//Fill everything with sand
	for(int i =0; i < game_grid_elements; i++)
	{
		_line_map.clear();

		for(int j = 0; j < game_grid_elements; j++)
		{
				_line_map.push_back(SAND);
		}
		_lines_map.push_back(_line_map);
	}

	_screen_map = _lines_map;

	//Now, Lets make some paths for digdug
	for(int i =game_grid_elements/2 -1; i < game_grid_elements/2 + 2; i++)
	{
		for(int j = 0; j < game_grid_elements/2; j++)
		{
		_screen_map[i][j] = HOLE;
		}
	}

	//And for the monster
	
	
}

 void Map::setBitmap()
 {
	 bmap = Bitmaps::get_default_bitmap(SAND);
 }